//
//  ARTWatchHistoryDailyPrView.m
//  ChartsDemo
//
//  Created by yunda on 2021/10/13.
//

#import "ARTWatchHistoryDailyPrView.h"

@implementation ARTWatchHistoryDailyPrView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-  (instancetype)init{
    self = [super init];
    if (!self) {
        return nil;
    }
    // init code
    self.frame = J_Frame(15, 0, J_SCREEN_WIDTH-15*2, 20);
    [self addSubview:self.titleView];
    [self addSubview:self.chartView];
    self.v_h = _chartView.v_MaxY+10;
    
    J_ViewRadius(self, 10);
    
//    _chartView.valueArray = @[@(55),@(60),@(80),@(76)];
//    [_chartView startDrawing];
    return self;
}

- (ARTWatchHistoryCommonChartTitleView *)titleView{
    if (!_titleView) {
        _titleView = [[ARTWatchHistoryCommonChartTitleView alloc]initWithFrame:J_Frame(0, 0, self.v_w, 20)];
    }
    return _titleView;
}

- (ARTLineChartView *)chartView{
    if (!_chartView) {
        _chartView = [[ARTLineChartView alloc]initWithFrame:J_Frame(0, _titleView.v_MaxY, self.v_w, 140)];
//        _chartView.yLabelArray = @[
//            @"70",
//            @"80",
//            @"90",
//            @"100"
//        ];
//        _chartView.xLabelArray = @[@"2021-10-12",@"2021-10-12",@"2021-10-12",@"2021-10-12"];
    }
    return _chartView;
}

@end
